import { IsOptional, IsPositive } from 'class-validator';
import { Transform } from 'class-transformer';
export class GetListDto {
  @IsOptional()
  @Transform(({ value }) => parseInt(value))
  @IsPositive()
  page = 1;

  @IsOptional()
  @Transform(({ value }) => parseInt(value))
  @IsPositive()
  limit = 10;

  @IsOptional()
  @Transform(({ value }) => Boolean(value))
  count = false;

  get skip(): number {
    return (this.page - 1) * this.limit;
  }
}
